﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameServer.Networking.Packets
{
    class PACKET_DELETE_COSTUME : Packet
    {
        public PACKET_DELETE_COSTUME(Virtual_Objects.User.virtualUser User, string itemCode)
        {
            newPacket(30225);
            addBlock(1);
            addBlock(itemCode);
            // Costume Inventory //
            StringBuilder Costumes = new StringBuilder(); int CostumeCount = 0;
            for (int I = 0; I < 30; I++)
            {
                if (User.Costume[I] != null)
                {
                    CostumeItem _Inv = User.Costume[I];
                    TimeSpan ExpireTime = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(_Inv._StartTime);

                    Costumes.Append(_Inv._Code.ToUpper() + "-3-3-" + _Inv._StartTime + "-0-0-0-0-0-9999-9999,");/*+ ExpireTime.TotalSeconds +*/
                    CostumeCount++;
                }
            }

            for (int I = 0; I < (60 - CostumeCount); I++)
            {
                Costumes.Append("^,");
            }

            addBlock(Costumes.ToString().Remove(Costumes.ToString().Length - 1));

            string CostumeE = User.CostumeE;
            string CostumeM = User.CostumeM;
            string CostumeS = User.CostumeS;
            string CostumeA = User.CostumeA;
            string CostumeH = User.CostumeH;

            addBlock(CostumeE);
            addBlock(CostumeM);
            addBlock(CostumeS);
            addBlock(CostumeA);
            addBlock(CostumeH);

        }
    }
}
